package models

// 奖品规则
type MaLotteryPrizeRule struct {
	ID                string  `gorm:"primaryKey;column:id;autoIncrement;type:bigint unsigned;not null;comment:唯一ID" json:"id" json_old:"ID"`
	Sort              int     `gorm:"column:sort;type:int;size:64;not null;default:0;comment:排序值" json:"sort"`
	LotteryActivityID string  `gorm:"column:lottery_activity_id;type:int;size:64;not null;comment:抽奖活动ID" json:"lottery_activity_id"`
	Total             int64   `gorm:"column:total;type:int;size:64;not null;comment:奖品总数，最多抽中的活动奖品" json:"total"`
	Name              string  `gorm:"column:name;type:varchar(30);not null;comment:奖项规则名称" json:"name"`
	LotteryPrizeType  int     `gorm:"column:lottery_prize_type;type:tinyint(1);not null;comment:奖品类型:1实物礼品 2虚拟礼品 3 积分 4 电子券" json:"lottery_prize_type"`
	WinOdds           float64 `gorm:"column:win_odds;type:decimal(10,2);default:0.00;not null;comment:赢的几率：0-100" json:"win_odds"`
	RuleType          int64   `gorm:"column:rule_type;type:int;size:64;comment:奖品类型 1实物奖品2谢谢惠顾" json:"rule_type"`
	CreatedAt         int64   `gorm:"column:created_at;autoCreateTime;type:int;size:64;comment:创建时间" json:"created_at"`
	UpdatedAt         int64   `gorm:"column:updated_at;autoUpdateTime;type:int;size:64;comment:修改时间" json:"updated_at"`
	DeletedAt         int64   `gorm:"column:deleted_at;type:int;size:64;default:0;comment:删除时间" json:"deleted_at"`
}

func (m MaLotteryPrizeRule) TableName() string {
	return "ma_lottery_prize_rule"
}
